package net.csdn.business.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Auther: zhangyalei
 * @Date: 2023/1/30 16:37
 * @Description: 里程碑目标状态
 */

@Getter
@AllArgsConstructor
public enum MilepostGoalStatus {
    ON(1, "已开启"),
    OFF(2, "已关闭");

    private Integer code;
    private String desc;

    public static MilepostGoalStatus ofCode(Integer code) {
        if (code == null) {
            return null;
        }
        for (MilepostGoalStatus type : MilepostGoalStatus.values()) {
            if (type.code.equals(code)) {
                return type;
            }
        }
        return null;
    }
}
